Page({
  data: {

    swiperList: ['/assets/images/common/banner.png', '/assets/images/common/banner.png', '/assets/images/common/banner.png'],
    activityList: [
      { icon: '/assets/images/common/icon-activity1.png', title: '同学名录', url: '/pages/alumni-list/alumni-list' },
      { icon: '/assets/images/common/icon-activity2.png', title: '班级相册', url: '/pages/photo-list/photo-list' },
      { icon: '/assets/images/common/icon-activity3.png', title: '班级活动', url: '/pages/activity-list/activity-list' },],
    workList: [
      { icon: '/assets/images/common/icon-activity1.png', title: '同学名录', url: '/pages/news-list/news-list' },
      { icon: '/assets/images/common/icon-activity2.png', title: '班级相册', url: '/pages/contact-us/contact-us' },
      { icon: '/assets/images/common/icon-activity3.png', title: '班级活动', url: '/pages/alumni-list/alumni-list' },
    ]
  },
  onLoad(options) {
    this.getTabBar().init('class');
  },

  gotoOther(e) {
    const { url } = e.currentTarget.dataset
    wx.navigateTo({
      url: `${url}?source=class`,
      fail() {
        wx.switchTab({ url, })
      }
    })
    console.log(e);
  },
  changeSwiper(e) {
    const { current } = e.detail
    this.setData({ campusStyleCurrent: current })
  },
  onTapBanner(e) {
    console.log(e);
  },
  gotoDetail(e) {
    const { url, id } = e.currentTarget.dataset
    console.log(`${url}?id=${id}`);
    wx.navigateTo({ url: `${url}?id=${id}` })
  }
})